package drds.binlog.binlog_event.event.unimportance;

import drds.binlog.binlog_event.LogByteBlock;
import drds.binlog.binlog_event.LogEvent;
import drds.binlog.binlog_event.event.FormatDescriptionLogEvent;
import drds.binlog.binlog_event.event.LogHeader;
import drds.binlog.common.Authors;
import drds.common.Author;
import lombok.Getter;
import lombok.Setter;

/**
 * Execute_load_log_event.
 */
@Author(name = Authors.LI_YANG)
public final class ExecuteLoadLogEvent extends LogEvent
{

    /* el = "execute load" */
    public static final int el_file_id_offset = 0;
    @Setter
    @Getter
    private final long fileId;

    public ExecuteLoadLogEvent(LogHeader logHeader, LogByteBlock logByteBlock, FormatDescriptionLogEvent formatDescriptionLogEvent)
    {
        super(logHeader);

        final int commonHeaderLength = formatDescriptionLogEvent.commonHeaderLength;
        logByteBlock.setIndexAsOriginIndexAndOffset(commonHeaderLength + el_file_id_offset);
        fileId = logByteBlock.getLittleEndian4UnsignedLongByIndex(); // EL_FILE_ID_OFFSET
    }
}
